package com.lh.controller;

import cn.hutool.json.JSONObject;
import com.lh.utils.Answer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.lh.entity.table.AreaInfo;
import com.lh.service.AreaService;

@RestController
@RequestMapping("/area")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @RequestMapping("/addAreaInfo")
    public Answer<Object> addAreaInfo(@RequestBody AreaInfo areaInfo) {
        return  areaService.addAreaInfo(areaInfo);
    }

    @RequestMapping("/updateAreaInfo")
    public Answer<Object> updateAreaInfo(@RequestBody AreaInfo areaInfo) {
        return  areaService.updateAreaInfo(areaInfo);
    }

    @RequestMapping("/deleteAreaInfo")
    public Answer<Object> deleteAreaInfo(@RequestBody AreaInfo areaInfo) {
        return  areaService.deleteAreaInfo(areaInfo);
    }

    @RequestMapping("/getAreaInfo")
    public Answer<Object> getAreaInfo(@RequestBody AreaInfo areaInfo) {
        return  areaService.getAreaInfo(areaInfo);
    }

    @RequestMapping("/getAreaChildInfo")
    public Answer<Object> getAreaChildInfo(@RequestBody AreaInfo areaInfo) {
        return  areaService.getAreaChildInfo(areaInfo);
    }

    @RequestMapping("/getAllAreaInfo")
    public Answer<Object> getAllAreaInfo() {
        return  areaService.getAllAreaInfo();
    }

    @RequestMapping("/queryAreaInfoPage")
    public Answer<Object> queryAreaInfoPage(@RequestBody JSONObject reqJson) {
        return  areaService.queryAreaInfoPage(reqJson);
    }
}
